﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Javavaj.iHunter.Core
{
    internal class ViewerWrapper : PluginWrapper, IViewer
    {
        IViewer viewer;
        public ViewerWrapper(IViewer viewer)
            : base(viewer)
        {
            this.viewer = Plugin as IViewer;
        }
        #region IViewer 成员

        public string[] DocumentTypes
        {
            get {

                return viewer.DocumentTypes;
            }
        }





        public System.Windows.Forms.Control CreateControl()
        {
            try
            {
                return viewer.CreateControl();
            }
            catch (Exception e)
            {
                OnPluginError(e);
                return null;
            }

        }

        public void ShowDocument(System.Windows.Forms.Control control, string docType, System.IO.Stream doc)
        {
            try
            {
                viewer.ShowDocument(control, docType, doc);
            }
            catch (Exception e)
            {
                OnPluginError(e);
            }
        }

        #endregion

        #region IViewer 成员


        public void PrintDocument(System.Drawing.Graphics g)
        {
            throw new NotImplementedException();
        }

        #endregion
    }
}
